﻿using DBUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace TTSDAL
{
   public class T0002028_SummaryReport
    { 
        private const string PARM_StartSN = "@StartSN";
        private const string PARM_EndSN = "@EndSN";
        private const string PARM_TestType = "@TestType";
        private const string PAEM_PageIndex = "@PageIndex";
        public DataSet GetSummaryDataSet(int pageIndex, string datatablename, string _startSN, string _endSN, string _productType)
        {
            SqlParameter[] parms = GetParameters();
            parms[0].Value = _startSN;
            parms[1].Value = _endSN;
            parms[2].Value = _productType;
            parms[3].Value = pageIndex;
            return sqlHelper.GetDataSet(pageIndex,"T0002028_TestSummaryReport", datatablename, sqlHelper.ConnectionStringLocalTransaction, parms);
        }


        public DataSet GetFirstTestDataSet(string datatablename, string _startSN, string _endSN)
        {
            SqlParameter[] parms = GetFParameters();
            parms[0].Value = _startSN;
            parms[1].Value = _endSN;
            return sqlHelper.GetDataSet("T0002028_FirstTest", datatablename, sqlHelper.ConnectionStringLocalTransaction, parms);
        }



        public SqlParameter[] GetFParameters()
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter(PARM_StartSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_EndSN, SqlDbType.NVarChar, 10) 
            };
            return parms;
        }


        public SqlParameter[] GetParameters()
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter(PARM_StartSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_EndSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_TestType, SqlDbType.NVarChar, 10), 
                new SqlParameter(PAEM_PageIndex,SqlDbType.Int, 4)
            };
            return parms;
        }
    }
}
